<template>
    <div>
        <!-- 账号：<input type="text" v-model="username"><br>
        密码：<input type="text" v-model="password"><br> -->
        <el-input v-model="name"></el-input>
      <el-button @click="login">登录</el-button>
    </div>
</template>

<script>
export default {
    name: 'HomeView',
    data() {
        return {
            // username:"111",
            // password:"111",
            name:"",
            // urllist:[],
        };
    },
    props: {},

    components: {},

    created() {},

    mounted() {},

    methods: {
        login(){
            this.axios.post("/login", {
                name: this.name
            })
            .then((resp) => {
                console.log("登录成功", resp)
                // console.log(resp.data.data);
                // for (var i=0; i<resp.data.data.length; i++){
                //     // console.log(a[i])
                //     this.urllist.push(i.url)
                // }
                localStorage.setItem("user_id",resp.data.data.user_id)
                this.$router.push(resp.data.data.url)
            }).catch((err) => {
                console.log(err)
            });
        }
    },

    computed: {},

    watch: {},

    directives: {},

    filters: {}
};
</script>

<style scoped></style>
